﻿using Iworld.ViewModel;
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Iworld.Backstage.Framework
{
    public class FilterBoxModel : ModelBase
    {
        Action<object> action = null;

        bool selected = false;

        public string Display { get; set; }

        public object Value { set; get; }

        public bool Selected
        {
            get { return selected; }
            set
            {
                if (selected == value) { return; }
                selected = value;
                OnPropertyChanged("Selected");
                if (selected == false) { return; }
                if (action == null) { return; }
                this.action(1);
            }
        }
        public FilterBoxModel(string display, object value, Action<object> action, bool selected = false)
        {
            this.Display = display;
            this.Value = value;
            this.action = action;
            this.selected = selected;
        }



    }
}
